﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ZLDC.Common.Estate;
using System.Data;
using System.Text;

namespace ZLDC.Estate.Page
{
    public partial class PageClose : System.Web.UI.Page
    {
        public int fku = 0;
        protected void Page_Load(object sender, EventArgs e)
        {
            a1.InnerHtml = _Utility.GetInfoBySession().m_sUserName;
            Getuserlist();
        }

        protected void btnAdd_Click(object sender, EventArgs e)
        {
           
            int i=ZLDC.Topo.BLL.Estate.lp_Basis.lp_Configuration_main_add("");
        }

        protected void Getuserlist()
        {
              string sql = "select COUNT(1) from lp_Configuration_main where Convert(varchar,workDay,23)='" + DateTime.Now.ToString("yyyy-MM-dd") + "' and deptID=" + _Utility.GetInfoBySession().m_sDeptID + " and Other1!='0' and Other1!='1'";
                DataSet ds = ZLDC.Topo.BLL.Estate.lp_Basis.Getds(sql);
                 if (ZLDC.Topo.BLL.Estate.lp_Basis.rtcount(ds))
                 {
                     if ( int.Parse(ds.Tables[0].Rows[0][0].ToString()) ==0)
                     {

                         Button2.Style["color"] = "black";
                     }
                 }
                 sql = "select count(1) from lp_Configuration_main where workDay ='" + DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd") + "' and isConfirm=0 and deptID=" + _Utility.GetInfoBySession().m_sDeptID;
                  ds = ZLDC.Topo.BLL.Estate.lp_Basis.Getds(sql);
                  if (ZLDC.Topo.BLL.Estate.lp_Basis.rtcount(ds))
                 {
                     if (ds.Tables[0].Rows[0][0].ToString() == "0")
                     {
                         Button1.Style["color"] = "black";
                     }
                 }
        }
    }
}
